<?
include_once "../main.php";

$n = $En + 1;

?>

<SCRIPT LANGUAGE="JavaScript">

function checkFields() {
missinginfo = "";

if (document.form.E_i.value == "") {
missinginfo += "\n     -  Institution name";
}
if (document.form.ESmonth.value == "") {
missinginfo += "\n     -  Start date / Month";
}
if (document.form.ESyear.value == "") {
missinginfo += "\n     -  Start date / Year";
}
if (document.form.EEmonth.value == "") {
missinginfo += "\n     -  End date / Month";
}
if (document.form.EEyear.value == "") {
missinginfo += "\n     -  End date / Year";
}
if (document.form.E_gr.value == "") {
missinginfo += "\n     -  Education level";
}
if (document.form.E_d.value == "") {
missinginfo += "\n     -  Description";
}

if(document.form.ESyear.value > document.form.EEyear.value) {
missinginfo += "\nSelect correct values for start and end years, please!";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}

</script>

<form method=post action="<?=$PHP_SELF?>"   name=form onSubmit="return checkFields();">
<table align=center width=460 class=BlackText>
<tr>
	<td colspan=2 align=center class=HeaderClass>Education #<?=$n?></td>
</tr>

<tr>
	<td align=right><b>Institution name: </b></td>
	<td><input type=text name=E_i size=27></td>
</tr>

<tr>
	<td align=right><b>Start date: </b></td>

	<td>
	<select name=ESmonth>
	<option value=""> Month </option>
	<option value=January> January </option>
	<option value=February> February </option>
	<option value=March> March </option>
	<option value=April> April </option>
	<option value=May> May </option>
	<option value=June> June </option>
	<option value=July> July </option>
	<option value=August> August </option>
	<option value=September> September </option>
	<option value=October> October </option>
	<option value=November> November </option>
	<option value=December> December </option>
	</select>

	<select name=ESyear>
	<option value=""> Year &nbsp;&nbsp;&nbsp;&nbsp;</option>
	<?
	for($i = date(Y); $i >= date(Y) - 70; $i--)
	{
		echo "<option value=\"$i\">$i</option>\n\t";
	}
	?>	
	</select>
	</td>
</tr>

<tr>
	<td align=right><b> End date: </b></td>

	<td>
	<select name=EEmonth>
	<option value=""> Month </option>
	<option value=Present class=Pres> Present </option>
	<option value=January> January </option>
	<option value=February> February </option>
	<option value=March> March </option>
	<option value=April> April </option>
	<option value=May> May </option>
	<option value=June> June </option>
	<option value=July> July </option>
	<option value=August> August </option>
	<option value=September> September </option>
	<option value=October> October </option>
	<option value=November> November </option>
	<option value=December> December </option>
	</select>

	<select name=EEyear>
	<option value=""> Year </option>
	<option value=Present class=Pres>Present </option>
	<?
	for($i = date(Y) - 1; $i >= date(Y) - 70; $i--)
	{
		echo "<option value=\"$i\">$i</option>\n\t";
	}
	?>
	</select>
	</td>
</tr>

<tr>
	<td align=right><b>Professional: </b></td>
	
	<td>
	<select name="E_gr" style="width:170">
	<option value=""> Select </option>
	<OPTION VALUE="Student (High School)">Student (High School)</OPTION>
	<OPTION VALUE="Colage">Collage</OPTION>
	<OPTION VALUE="Bachelor"> Bachelor </OPTION>
	<OPTION VALUE="Master"> Master </OPTION>	
	<OPTION VALUE="Ph D">Ph D</OPTION>
	</select>
	</td>
</tr>

<tr>
	<td valign=top align=right><b>Description: </b><br>(do not use HTML, please)</td>
	<td><textarea name=E_d rows=6 cols=32></textarea></td>
</tr>

<tr>
	<td colspan=2 align=center>
	<input type=hidden name=En value=<?=$n?>>
	<input type=submit name=submit value="Save this and add another one">
	</td>
</tr>

<tr>
	<td colspan=2 align=center>
	<input type=hidden name=En value=<?=$n?>>
	<input type=submit name=submit value="Save this and go to Step 3 (Skills)">
	</td>
</tr>
</form>

</table>

<? include_once('../footer.php'); ?>